package cn.wolfcode.crm.mapper;

import cn.wolfcode.crm.domain.Role;
import cn.wolfcode.crm.query.QueryObject;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface RoleMapper {
    int deleteByPrimaryKey(Long id);

    int insert(Role record);

    Role selectByPrimaryKey(Long id);

    List<Role> selectAll();

    int updateByPrimaryKey(Role record);

    int selectForCount(QueryObject qo);

    List<Role> selectForList(QueryObject qo);

    /**
     * 插入角色和权限个关系数据
     * @param roleId
     * @param permissionId
     */
    void insertRelation( @Param("roleId") Long roleId,@Param("permissionId") Long permissionId);

    /**
     * 删除角色和权限的关系
     * @param roleId
     */
    void deleteRelation(Long roleId);

    //查询角色的sn
    List<String> selectSnByEmpId(Long id);
}